import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import router from './router'
import '../public/css/global.css'
import './assets/fonts/iconfont.css'
import Breadcrumb from './components/Breadcrumb.vue'
import VueQuillEditor from 'vue-quill-editor'

import 'quill/dist/quill.core.css' 
import 'quill/dist/quill.snow.css' 
import 'quill/dist/quill.bubble.css' 

Vue.use(VueQuillEditor)

import * as api from './api'
import TreeTable from 'vue-table-with-tree-grid'

Vue.component('tree-table', TreeTable)
Vue.prototype.$http = api
Vue.component('Breadcrumb', Breadcrumb)
Vue.config.productionTip = false
Vue.use(ElementUI);
//全局过滤器格式化时间
Vue.filter('dateFormat', function (originVal) {
    const dt = new Date(originVal)
    //年
    const y = dt.getFullYear()
    //月
    const m = (dt.getMonth() + 1 + '').padStart(2, '0')
    //日
    const d = (dt.getDate() + '').padStart(2, '0')
    //时
    const hh = (dt.getHours() + '').padStart(2, '0')
    //分
    const mm = (dt.getMinutes() + '').padStart(2, '0')
    //秒
    const ss = (dt.getSeconds() + '').padStart(2, '0')

    return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})

new Vue({
    router,
    render: h => h(App)
}).$mount('#app')